Common Response Envelope
Every route returns:
{
"status": "success",
"data": {},
"code": 0,
"message": "OK"
}
Field format and behavior:
| Field | JSON type | Format | Presence rules |
|---|---|---|---|
status | string | success or error | Always present |
data | object/null | Route-specific payload | May be omitted or null when there is no payload |
code | integer/null | Error code (typically negative for business/processing errors) | Present for error responses; may be omitted or null for successful responses |
message | string/null | Human-readable diagnostic text (UTF-8) | Usually present for error responses; may be omitted or null for successful responses |
Parsing recommendation:
- Always parse by
statusfirst. - Treat
dataas route-specific and optional. - Do not rely on
messagetext for business logic; usecodeand route context.